import React, { Component } from "react"
import "./index.css"
import { Input, Space } from 'antd';
import { Table, Tag } from 'antd';
import RightContainer from "../../../components/RightContainer"
const { Search } = Input;

class list extends Component {
  rrr(key) {
    console.log(key)
    let {data}=this.state
    data.splice(key,1)
  }
  state = {
    columns: [
      {
        title: '品牌',
        dataIndex: 'name',
        key: 'name',
        render: text => <a>{text}</a>,
      },
      {
        title: '产品类型',
        dataIndex: 'age',
        key: 'age',
      },
      {
        title: '所在城市',
        dataIndex: 'address',
        key: 'address',
      },
      {
        title: '品牌来源',
        dataIndex: 'addy',
        key: 'addy',
      },
      {
        title: '姓名',
        dataIndex: 'addif',
        key: 'addif',
      },
      {
        title: '电话',
        dataIndex: 'phone',
        key: 'phone',
      },
      {
        title: '职位',
        dataIndex: 'position',
        key: 'position',
      },
      {
        title: '申请时间',
        key: 'tags',
        dataIndex: 'tags',

      },
      {
        title: '是否已处理',
        key: 'dispose',
        dataIndex: 'dispose',

      },
      {
        title: '操作',
        key: 'action',
        render: (text, record) => (
          console.log(record),
          <Space size="middle">
            <a>编辑</a>
            <a onClick={()=>this.rrr(record.key)} >删除</a>
          </Space>
        ),
      },
    ],

    data: [
      {
        key: '1',
        name: 'John',
        age: 32,
        address: 'New',
        tags: 'developer',
        addy: "sfsdff",
        addif: "收款机房不好",
        phone: "jgjggvh",
        position: "就黄果树",
        dispose: "ysgdsdc"
      },
      {
        key: '2',
        name: 'Green',
        age: 42,
        address: 'London ',
        tags: ['loser'],
        addy: "sfsdff",
        addif: "收款机房不",
        phone: "jgjggvh",
        position: "就黄果树",
        dispose: "ysgdsdc"
      },
      {
        key: '3',
        name: 'Black',
        age: 32,
        address: 'Sidney',
        tags: 'teacher',
        addy: "sfsdff",
        addif: "收款机房不好",
        phone: "jgjggvh",
        position: "就黄果树",
        dispose: "ysgdsdc"
      },
    ]

  }
  componentDidMount() {

  }
  onSearch = value => console.log(value);
  render() {
    const { data, columns } = this.state
    return <RightContainer>
      <div >
        <Search placeholder="请输入名称" onSearch={this.onSearch} style={{ width: 200 }} />
      </div>
      <div>
        <Table columns={columns} dataSource={data} />
      </div>
    </RightContainer>
  }
}
export default list